package com.sloth.bear.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * OSS配置属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "oss")
public class OssProperties {

    /**
     * OSS类型: upyun(又拍云), qiniu(七牛云)
     */
    private String type = "qiniu";

    /**
     * 又拍云配置
     */
    private UpYunConfig upyun = new UpYunConfig();

    /**
     * 七牛云配置
     */
    private QiniuConfig qiniu = new QiniuConfig();

    @Data
    public static class UpYunConfig {
        private String bucket;
        private String operator;
        private String password;
        private String domain;
    }

    @Data
    public static class QiniuConfig {
        private String accessKey;
        private String secretKey;
        private String bucket;
        private String domain;
    }
}
